//
//  YXUserInfoModel.m
//  CreditCard
//
//  Created by 杨旭 on 2017/12/29.
//  Copyright © 2017年 杨旭. All rights reserved.
//

#import "YXUserInfoModel.h"

@implementation YXUserInfoModel

//序列化,归档时系统会自动调用的方法
- (void)encodeWithCoder:(NSCoder *)aCoder {
    
    [aCoder encodeObject:_ID forKey:@"ID"];
    [aCoder encodeObject:_name forKey:@"name"];
    [aCoder encodeObject:_sessionId forKey:@"sessionId"];
    [aCoder encodeObject:_pid forKey:@"pid"];
    [aCoder encodeObject:_phone forKey:@"phone"];
    [aCoder encodeObject:_imgUrl forKey:@"imgUrl"];
    [aCoder encodeObject:_idCard forKey:@"idCard"];
    [aCoder encodeObject:_state forKey:@"state"];

    
    [aCoder encodeObject:_certification forKey:@"certification"];
    [aCoder encodeObject:_artificialper forKey:@"artificialper"];
    
    
    [aCoder encodeObject:_freezingAmount forKey:@"freezingAmount"];
    [aCoder encodeObject:_branchAmount forKey:@"branchAmount"];
    [aCoder encodeObject:_availableAmount forKey:@"availableAmount"];

    
    [aCoder encodeObject:_idCardBackImgUrl forKey:@"idCardBackImgUrl"];
    [aCoder encodeObject:_idCardFrontImgUrl forKey:@"idCardFrontImgUrl"];
}

//反序列化,反归档时系统会自动调用的方法
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super init]) {
        
        _ID = [aDecoder decodeObjectForKey:@"ID"];
        _name = [aDecoder decodeObjectForKey:@"name"];
        _sessionId = [aDecoder decodeObjectForKey:@"sessionId"];
        _pid = [aDecoder decodeObjectForKey:@"pid"];
        _phone = [aDecoder decodeObjectForKey:@"phone"];
        _imgUrl = [aDecoder decodeObjectForKey:@"imgUrl"];
        _idCard = [aDecoder decodeObjectForKey:@"idCard"];
        _state = [aDecoder decodeObjectForKey:@"state"];

        _certification = [aDecoder decodeObjectForKey:@"certification"];
        _artificialper = [aDecoder decodeObjectForKey:@"artificialper"];
        
        _freezingAmount = [aDecoder decodeObjectForKey:@"freezingAmount"];
        _branchAmount = [aDecoder decodeObjectForKey:@"branchAmount"];
        _availableAmount = [aDecoder decodeObjectForKey:@"availableAmount"];

        
        _idCardBackImgUrl = [aDecoder decodeObjectForKey:@"idCardBackImgUrl"];
        _idCardFrontImgUrl = [aDecoder decodeObjectForKey:@"idCardFrontImgUrl"];
    }
    return self;
}

@end
